package com.my.study.config.hook.bean;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;

import java.util.Arrays;

/**
 * <p>Bean初始化完成扩展点</p>
 * <p>通过@Bean注入Bean的时候可以指定初始化方法</p>
 *
 * @author: yidujun
 * @create: 2021/04/02 16:27
 */
@Slf4j
public class InitMethodExampleBean {
    @Autowired
    private Environment environment;

    public void init() {
        log.info("InitMethodExampleBean -> {}", Arrays.asList(environment.getDefaultProfiles()));
    }
}
